文章目录
  1. 1. 打上 tag
  2. 2. push
  3. 3. pull

搭建完自己的docker-regsitry后需要push image过去,先要用 docker tag 给 image 添加一个 tag。然后用这个 tag 名去做 push ,原因是 docker push 时似乎需要`主机名/镜像名`的格式。

打上 tag

1
docker tag ubuntu:xunsearch 192.168.0.130:5000/xunsearch

192.168.0.130:5000 是我的 docker-regsitry 服务的ip地址和端口号。

push

1
docker push 192.168.0.130:5000/xunsearch

这个时候慢慢等,第一次提交会比较慢,初始镜像会比较大,以后再提交的时候只会提交修改的部分,这样就比较快了。

完成后会显示类似下面的信息

1
Pushing tags for rev [0275deda3035ae203567b1590d646378b1ac86ba5bdb0e465a22b2a561965dd1] on {http://192.168.0.130:5000/v1/repositories/xunsearch/tags/latest}

pull

1
docker pull 192.168.0.130:5000/xunsearch

完成后会显示类似下面的信息

1
2
Pulling repository 192.168.0.130:5000/xunsearch
0275deda3035: Download complete

push 和 pull 有点 git 的感觉。

通过使用 docker images -tree 可以看到树状的结构信息。

文章目录
  1. 1. 打上 tag
  2. 2. push
  3. 3. pull